/**
 * 
 */
package org.demetra.core;

import org.demetra.core.WorkerLoop;

import com.ericsson.otp.erlang.OtpErlangAtom;
import com.ericsson.otp.erlang.OtpErlangObject;
import com.ericsson.otp.erlang.OtpMbox;

/**
 * @author vvorobyov
 *
 */
public class JetsSession extends WorkerLoop {
	enum OpCode
	{
		AddTuples,
		RemoveTuples,
		LookupTuples,
		CountTuples,
		CleanSession;
	}

	/**
	 * @param mbox
	 */
	public JetsSession(OtpMbox mbox) {
		super(mbox);
	}

	/* (non-Javadoc)
	 * @see org.demetra.jets.WorkerLoop#handleRequest(com.ericsson.otp.erlang.OtpErlangAtom, com.ericsson.otp.erlang.OtpErlangObject)
	 */
	@Override
	protected OtpErlangObject handleRequest(OtpErlangAtom opCodeAtom,
			OtpErlangObject requestData) {
		OpCode opCode = OpCode.valueOf(opCodeAtom.atomValue());
		switch (opCode)
		{
			case AddTuples:
			{
				break;
			}
			case RemoveTuples:
			{
				break;
			}
			case LookupTuples:
			{
				break;
			}
			case CountTuples:
			{
				break;
			}
			case CleanSession:
			{
				break;
			}
		}
		return tuple(atom("echo"),requestData);
	}
	
	/* (non-Javadoc)
	 * @see org.demetra.jets.WorkerLoop#close()
	 */
	@Override
	protected void close() throws Exception {
		super.close();
	}
}
